import { ChannelType } from '@/store/reducer/channel';
import request from '@/utils/request';
export const getAllChannelsAPI = () => request({ url: '/v1_0/channels' });

export const getUserChannelsAPI = () => request({ url: '/v1_0/user/channels' });

export const delUserChannelByIdAPI = (id: number) => {
  return request({ url: '/v1_0/user/channels/' + id, method: 'delete' });
};

export const addUserChannelAPI = (channels: ChannelType[]) => {
  return request({
    url: '/v1_0/user/channels',
    method: 'patch',
    data: {
      channels,
    },
  });
};
